import Vue from "vue";
import Router from "vue-router";

Vue.use(Router);

export default new Router({
  // mode: "history",
  routes: [
    {
      path: "/",
      redirect: "/index"
    },
    {
      path: "/",
      component: () => import("../components/common/Base.vue"),
      meta: {
        title: "公共部分"
      },
      children: [
        {
          path: "/index",
          component: () => import("../components/page/Home.vue"),
          meta: {
            title: "系统首页"
          }
        },
        {
          path: "/owner",
          name: "owner",
          component: () => import("../components/page/owner/index.vue"),
          meta: {
            title: "业主信息管理"
          }
        },
        {
          path: "/notice",
          name: "notice",
          component: () => import("../components/page/notice/index.vue"),
          meta: {
            title: "信息通报管理"
          }
        },
        {
          path: "/service",
          name: "service",
          component: () => import("../components/page/service/index.vue"),
          meta: {
            title: "服务反馈管理"
          }
        },
        {
          path: "/repair",
          name: "repair",
          component: () => import("../components/page/repair/index.vue"),
          meta: {
            title: "报修管理"
          }
        },
        {
          path: "/information",
          name: "information",
          component: () => import("../components/page/information/index.vue"),
          meta: {
            title: "小区信息管理"
          }
        },
        {
          path: "/car",
          name: "car",
          component: () => import("../components/page/car/index.vue"),
          meta: {
            title: "车位管理"
          }
        },
        {
          path: "/house",
          name: "house",
          component: () => import("../components/page/house/index.vue"),
          meta: {
            title: "房屋管理"
          }
        },
        {
          path: "/admin",
          name: "admin",
          component: () => import("../components/page/admin/index.vue"),
          meta: {
            title: "管理员管理"
          }
        }
      ]
    },
    {
      path: "/login",
      component: () => import("../components/page/Login.vue")
    },
    {
      path: "/error",
      component: () => import("../components/page/Error.vue")
    },
    {
      path: "/404",
      component: () => import("../components/page/404.vue")
    }
  ]
});
